home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 034a / twview82.zip / PART4.INC < prev    next >
Text File  |  1991-02-04  |  1KB  |  41 lines

  1. procedure partIV( var space : TheVoid );
  2. var
  3.   Exists : array [ sector ] of boolean;
  4.   temp,
  5.   was    : boolean;
  6.   n      : integer;
  7.   s      : sectorIndex;
  8.   line   : string;
  9. begin
  10.   for s := 1 to MaxSector do
  11.     exists[ s ] := false;
  12.   repeat
  13.     readln( f, line );
  14.   until pos( 'Deployed  Fighter  Scan', line) > 0;
  15.   readln( f, line );   {blank}
  16.   readln( f, line );   { Sector Fighters ...}
  17.   readln( f, line );   {===}
  18.   readln( f, line );   {first line of display}
  19.   while pos( 'Total', line) = 0 do
  20.     begin
  21.       temp := bval( copy(line, 1, 6), n );
  22.       s := n;
  23.       exists[ s ] := true;
  24.       readln( f, line );
  25.     end; {while}
  26.   for s := 1 to MaxSector do
  27.     begin
  28.       Was := (space.sectors[ s ].etc and HasFighters) <> Nothing;
  29.       if was and (not exists[ s ]) then
  30.         begin
  31.           writeln('Lost fighters in sector ', s );
  32.           space.sectors[s].etc := space.sectors[s].etc and (not HasFighters);
  33.         end {if}
  34.       else if exists[ s ] and (not was) then
  35.         begin
  36.           writeln('New fighters in sector ', s );
  37.           space.sectors[s].etc := space.sectors[s].etc or HasFighters;
  38.         end; {else}
  39.     end; {for}
  40.   SaveData( g, space );
  41. end; {Part4}